//
//  TTRoomLeftView.swift
//  SSCodingOsx
//
//  Created by Toj on 3/16/21.
//  Copyright © 2021 TTProduct. All rights reserved.
//

import Cocoa

class TTRoomLeftView: NSView {
    
    private lazy var logoImageView: NSImageView = {
        let view = NSImageView()
        view.image = NSImage(named: "liveTitleLogo")
        return view
    }()
    
    private lazy var courseTypeImageView: NSImageView = {
        let view = NSImageView()
        view.image = NSImage(named: "coursesTypeC")
        return view
    }()
    
    private lazy var titleLabel: TTLabel = {
        let view = TTLabel()
        view.textColor = NSColor.init(hexColor: "#525C65")
        view.stringValue = "Python基础（上） |  课时1运算和运算符"
        view.font = NSFont.init(weight: .Bold, size: 12)
        return view
    }()
    
    override init(frame frameRect: NSRect) {
        super.init(frame: frameRect)
        
        setupMakeAddSubviews()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}

// MARK: - override
extension TTRoomLeftView {
    
    override func layout() {
        super.layout()
        
        setupMakeLayoutSubviews()
    }
}

// MARK: - 点击事件
extension TTRoomLeftView {
    
}

// MARK: - setup
extension TTRoomLeftView {
    
    private func setupMakeAddSubviews() {
        addSubview(logoImageView)
        addSubview(courseTypeImageView)
        addSubview(titleLabel)
    }
    
    private func setupMakeLayoutSubviews() {
        logoImageView.snp.makeConstraints { (make) in
            make.left.centerY.equalTo(self)
            make.width.equalTo(75)
            make.height.equalTo(26)
        }
        
        courseTypeImageView.snp.makeConstraints { (make) in
            make.left.equalTo(logoImageView.snp.right).offset(36)
            make.centerY.equalTo(logoImageView)
            make.width.equalTo(20)
            make.height.equalTo(20)
        }
        
        titleLabel.snp.makeConstraints { (make) in
            make.left.equalTo(courseTypeImageView.snp.right).offset(4)
            make.centerY.equalTo(logoImageView)
        }
    }
}
